<?

	include "./includes/messages.inc.php";

	include "./includes/config.inc.php";

	include "./includes/prepend.inc.php";

?>

<html>

<head>

<script type="text/javascript">

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

</script>

</head>

<body>



<?

if ($_SESSION["gate"] == "pp")

{

?>



	<form action="http://www.paypal.com/cgi-bin/webscr" method="post" name="form1">

	<input type="hidden" name="cmd"				value="_xclick">

	<input type="hidden" name="business"		value="<? echo $cfg["ppacct"]?>">

	<input type="hidden" name="item_name"		value="<? echo $cfg["ppdesc"] ?>">

	<input type="hidden" name="amount"			value="<? echo $_SESSION["amount"]+ ($cfg['pp_fee']/100)*$_SESSION["amount"]; ?>">

	<input type="hidden" name="no_shipping"		value="1">

	<input type="hidden" name="custom"			value="<? echo $_SESSION["orderid"]; ?>">

	<input type="hidden" name="return"			value="<? echo $rootp; ?>/paid.php">

	<input type="hidden" name="notify_url"		value="<? echo $rootp; ?>/ppipn.php">

	<input type="hidden" name="currency_code"	value="<? echo $currency_name; ?>">

	</form>



<? } elseif ($_SESSION["gate"] == "2co") { ?>



	<form name="form1"			method="post" action="https://www.2checkout.com/cgi-bin/sbuyers/cartpurchase.2c">

	<input name="sid"			type="hidden" id="sid"				value="<? echo $cfg["2coid"]?>">

	<input name="cart_order_id" type="hidden" id="cart_order_id"	value="<? echo $_SESSION["orderid"]; ?>">

	<input name="total"			type="hidden" id="sid"				value="<? echo $_SESSION["amount"]+ ($cfg['2co_fee']/100)*$_SESSION["amount"]; ?>">

	</form>



<? } elseif ($_SESSION["gate"] == "storm") { ?>



	<form name="form1" method=post action= "https://www.Stormpay.com/stormpay/handle_gen.php">

	   <input  type=hidden	name="generic"		value=1>

	   <input  type=hidden	name="test_mode"	value=1>

	   <input  type=hidden	name="payee_email"	value="<? echo $cfg["stormacct"]?>">

	   <input  type=hidden	name="product_name"	value= "<? echo $cfg["ppdesc"]?>">

	   <input  type=hidden	name="amount"		value=<? echo $_SESSION["amount"] + ($cfg['storm_fee']/100)*$_SESSION["amount"]; ?>>

	   <input  type=hidden	name="return_URL"	value="<? echo $rootp; ?>/stormipn.php">

	   <input  type=hidden	name="cancel_URL"	value="<? echo $rootp; ?>/stormipn.php">

	   <input type="hidden" name="user1"		value="<? echo $_SESSION["orderid"]; ?>">

	</form>



<? } ?>



<script type="text/javascript">

MM_findObj("form1").submit();

</script>

</body>

</html>